% calculate the distance between two locations
function result = distance(location_a, location_b)
result = sqrt((location_a(1) - location_b(1))^2 + (location_a(2) - location_b(2))^2);
end